<%--
  author: winkyle
  date: 2018/11/27
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- jsp文件头和头部 -->
    <%@ include file="../../base/top.jsp"%>
</head>
<body class="no-skin">
<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                            <table id="data-table1" width="100%" class="table table-striped table-bordered">
                                <thead>
                                <tr>
                                    <th>
                                        <input type="checkbox" id="check-all"/>
                                    </th>
                                    <th>序号</th>
                                    <th>名称</th>
                                    <th>日期</th>
                                    <th>类型</th>
                                    <th>大小</th>
                                </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                            <a class="btn btn-xs btn-primary"
                               id="load-all"
                               title="批量下载"><i
                                    class="ace-icon fa fa-download bigger-140"></i></a>
                    </div>
                    <!-- /.col -->
                </div>
                <!-- /.row -->
            </div>
            <!-- /.page-content -->
        </div>
    </div>
    <!-- /.main-content -->
    <!-- 返回顶部 -->
    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>
</div>

</form>
<!-- /.main-container -->
<!-- basic scripts -->
<!-- 页面底部js¨ -->
<%@ include file="../../base/foot.jsp"%>
<script type="text/javascript">
    $(top.hangge());

//    $("#load-all").click(function () {
//        var checked = getAllCheckedRowValue();
//        if(checked==null||checked.length<=0){
//            prompt_alert('warning','请至少选择一行',2);
//        }else {
//            for (var index = 0; index < checked.length; index++) {
//                download(checked[index].courseMaterialName + checked[index].fileType, checked[index].courseMaterialAddress);
//            }
//        }
//    });
    var teachCourseId = "${teachCourseId}";
    var table = null;
    var url='material/search_course_material_files';
    var param = {teachCourseId:teachCourseId};
    var columnsData =  [
        {
            bSortable : false,
            className : "text-left",
            width : "50px",
            'data': 'courseMaterialId',
            render : function(data, type, row, meta) {
                return "<input type=\"checkbox\"/>";
            }
        },
        {
            bSortable : false,
            data: null,
            width : "40px",
            className: 'text-center whiteSpace',
            render:function(data,type,row,meta) {
                return meta.row + 1 +
                    meta.settings._iDisplayStart;
            }
        },
        {'data': 'courseMaterialName'},
        {'data': 'teachCourseMaterialCreateTime'},
        {bSortable : false,'data': 'fileType'},
        {bSortable : false,'data': 'fileSize'}
    ];
    var dataBaseFiled =  [
        {'data': 'course_material_name'},
        {'data': 'teach_course_material_create_time'}
    ];
    $(document).ready(function() {
        table = $('#data-table1').DataTable($.extend(true,{},CONSTANT.DATA_TABLES.DEFAULT_OPTION,{
            columns:columnsData,
            ajax: function (data,callback) {
                ajax(data,callback,dataBaseFiled,url,param);
            },
            order:[[ 2, "asc" ]]
        }));
    });
</script>

</body>
</html>